#ifndef Algebra_MpiMessage_h
#define Algebra_MpiMessage_h

#include "AlgebraModule.h"
#include "mpi.h"

SG_NAMESPACE_OPEN
namespace Algebra
{
    /** Simplify the interfaces for MPI routines */
    template <typename TDataType>
    struct ALGEBRA_EXPORT MpiMessage
    {
        /** @name envelope */
        ///@{
        int source;  //< rank of source (integer).
        int dest;    //< rank of destination (integer).
        int tag;     //< message tag (integer).
        ///@}

        /** @name payload */
        ///@{
        TDataType             *buf   = nullptr;  //< initial address of send buffer.
        int                    count = 0;        //< number of elements in send buffer (nonnegative integer).
        //MpiDataType<TDataType> datatype;         //< datatype of each send buffer element (handle).
        ///@}
    };
}  // namespace Algebra

SG_NAMESPACE_CLOSE

#endif  //  Algebra_MpiMessage_h